home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / utility / pock40.zip / DEMO.BAT < prev    next >
DOS Batch File  |  1994-03-27  |  13KB  |  394 lines

  1. echo off
  2. cls
  3. d    /Yny// /'//@tThis is a DEMO for the program D.EXE (&WPocketD&w)//@tDo you want to proceed (Y@/N) ?'
  4. if not errorlevel 2 goto fin
  5. echo  This demonstration shows a small sample of D.EXE's features. The user is
  6. echo  advised to run MENUD.EXE for a complete interactive demonstration of the
  7. echo  full range of features, and to run README for illustrative examples.                     
  8. echo  All files other than the original PocketD release files will be ignored.
  9. echo  D.EXE's internal screen size is set to 80 cols by 11 rows for demonstration
  10. echo  purposes. ( The menus below are all directly controlled by D.EXE ).
  11. set d_opt2=/#80,11p:.d.exe /:.d.exe/- wh* .pcx
  12. set _=1
  13. if "%_%"=="1" goto envok
  14. echo Not enough environment space!
  15. goto fin1
  16. :envok
  17. d    /@n
  18. if errorlevel 21 goto main2
  19. echo Sorry! Demo requires full installation!
  20. goto fin1
  21.  
  22. :main
  23. cls
  24. echo Returning to main menu..
  25. :main2
  26. d    /Y_12345 /'//@t1. Directory formats/@t2. Template/@t3. File information/@t4. File selection/@t5. Help//@tESC exit//@t?'
  27. if errorlevel 6 goto help
  28. if errorlevel 5 goto select
  29. if errorlevel 4 goto stats
  30. if errorlevel 3 goto templ
  31. if errorlevel 2 goto disp
  32. goto exit
  33.  
  34. :disp
  35. cls
  36. d    /Y1234 /'//@tChoose://@t1. Normal,@/w,@/m and @/t format/@t2. Bestfit/@t3. Subdir summary/@t4. Tailoring//@tESC cancel//@t?'
  37. cls
  38. if errorlevel 4 goto tail
  39. if errorlevel 3 goto subdir
  40. if errorlevel 2 goto bestfit
  41. if errorlevel 1 goto wmt
  42. goto main
  43.  
  44. :wmt
  45. echo This is the default format: standard details sorted by file/dir name            
  46. echo     D                                            
  47. d    /K.31
  48. echo.
  49. pause
  50. cls
  51. echo This is the /w "wide" format giving only filename and size in KBytes                                    
  52. echo     D /w                                            
  53. d    /w
  54. echo.
  55. pause
  56. cls
  57. echo This is the /m "minimum" format giving only the filename                                
  58. echo     D /m                                            
  59. d    /m
  60. echo.
  61. pause
  62. cls
  63. echo This is the /t "tiny" format grouping files by extension                                        
  64. echo     D /t                                            
  65. d    /t
  66. echo.
  67. pause
  68. goto disp
  69.  
  70. :bestfit
  71. echo This is the "Best-fit" format which automatically chooses the display format.
  72. echo In this case /w format is chosen to fit the 80x11 format used by the demo.            
  73. echo     D /b                                        
  74. d    /b~.20
  75. echo.
  76. pause
  77. cls
  78. echo This can be modified by "column optimise" (/.k) to limit the No. of columns.
  79. echo In this case the layout is altered to 3 columns which still fits inside 11 rows.        
  80. echo      D /b/.k                                            
  81. d    /b~.20/.k
  82. echo.
  83. pause
  84. goto disp
  85.  
  86. :subdir
  87. echo This demonstrates some of the subdirectory summary features of PocketD
  88. d    /Yny// /'/This will require creation of temporary subdirectories with files/copied into them. Ok ?'
  89. if not errorlevel 2 goto disp
  90. echo      D N*.BAT D*.BAT /cc ATEMP1         ( command used for copy/create )        
  91. d    n*.bat d*.bat /cc atemp1 
  92. echo.
  93. md atemp2
  94. echo Subdirs ATEMP1 and ATEMP2 created                                
  95. pause
  96. cls
  97. echo The following uses /r to include a summary of the contents of subdir ATEMP1
  98. echo and ATEMP2
  99. echo     D /r                                            
  100. d    /rK.28
  101. echo.
  102. pause
  103. cls
  104. echo The following uses /S and /G to group contents of subdirs                    
  105. echo     D /wSG                                        
  106. d    .\AT* *.* /wSG~.35
  107. echo.
  108. pause
  109. cls
  110. d    /Y// /'//Deleting temporary files.'
  111. echo     D  atemp1 atemp2 /zd        ( command used to delete )                
  112. d    atemp1 atemp2 /Ihzd
  113. echo.
  114. pause
  115. goto disp
  116.  
  117. :tail
  118. echo PocketD offers 19 tailoring options. The following shows four of these:        
  119. echo 1. Unbroken names   2. 1jan91 date format   3. Lowercase   4. Sorting by row            
  120. echo     D /.umlr                                        
  121. d    /.umlr/~.28
  122. echo.
  123. pause
  124. goto disp
  125.  
  126. :templ
  127. cls
  128. echo PocketD has a very powerful TEMPLATE facility that can be used for display
  129. echo or execution purposes. It can accept 50 possible parameters, a few shown below.
  130. d    /Y12// /'//@tChoose://@t1. Display output/@t2. Execution//@tESC cancel//@t?'
  131. cls
  132. if errorlevel 2 goto t_exec
  133. if errorlevel 1 goto t_disp
  134. goto main
  135.  
  136. :t_disp
  137. echo The display template can be used in many ways. The simple example at the
  138. echo bottom of the screen simply outputs an X for each matching file/dir.            
  139. echo     D /w                                        
  140. d    /w
  141. echo.                                            
  142. echo     D [X]                                        
  143. d    [X]
  144. echo.
  145. pause
  146. cls
  147. echo The template can accept parameters such as $f giving the filename            
  148. echo     D [$f ]                                        
  149. d    [$f ]
  150. echo.
  151. echo.
  152. echo It can also accept formatted field widths e.g. $16f for padding to width 16        
  153. echo     D [$16f]                                    
  154. d    [$16f]
  155. echo.
  156. pause
  157. cls
  158. echo $10n gives only the name part without the extension, padded to width 10:            
  159. echo    D [$10n]                                        
  160. d    [$10n]
  161. echo.
  162. echo.
  163. echo "//" in the template will add a newline:                        
  164. echo     D ?????.* [$10n//]                                    
  165. d    ?????.* [$10n//]
  166. echo.
  167. pause
  168. goto templ
  169.  
  170. :t_exec
  171. echo PocketD can be used to run a template for a selected group of files. For
  172. echo example, the following could be used to move each file extension group to
  173. echo its own archive file. The $e option gives the extension part of the name.
  174. echo (R? below causes PocketD to echo each line without running it. R runs).        
  175. echo     D /e [PKZIP -m $e *.$e]R?                                
  176. d    /e [PKZIP -m $e *.$e]R?
  177. echo.
  178. pause
  179. cls
  180. echo PocketD can run multi-line sequences. e.g. To move each file extension
  181. echo group to its own subdir, named by the extension:                        
  182. echo     D /e [md $e//copy *.$e $e]R?
  183. D    /e [md $e//copy *.$e $e]R?!E- *.d*
  184. echo.
  185. pause
  186. cls
  187. echo PocketD can use separate templates for display and execution. This allows
  188. echo the user to browse the display template as a scrolling menu. In the example
  189. echo below $3# provides a file number, $F number of files, $d date, $t time, $s
  190. echo size. The 2nd template starts with [? indicating that it is a display template.
  191. echo The "((" template divider provides a section to appear for the 1st match only.
  192. echo The "Q" option turns the template into a menu (also allowing file viewing etc.).    
  193. echo    D [pkzip -m save $w][?  Choose from://(($3# of $F: $d $t $7s $13w Archive?]RQ            
  194. d    [  Choose from://(($3# of $F: $d $t $7s $13w Archive?]?~.10
  195. echo.
  196. pause
  197. cls
  198. echo PocketD can run alternative templates to give the user the choice of tasks.
  199. echo The example below allows the user to either move a file to an archive AND/OR
  200. echo copy it to drive A:. The user types "1" to execute the 1st template and "2"
  201. echo for the 2nd. This example could have used 2 display templates, giving 4 in all.    
  202. echo  D [pkzip -m save $w][copy $w A:][? $15w (1) Move to Archive (2) Copy to A:]QR        
  203.  
  204. D    [ $15w (1) Move to Archive (2) Copy to A:]?~.10
  205. echo.
  206. echo From this it can be seen that PocketD's templates potentially offer the user a
  207. echo great deal of power for file management. The user is recommended to follow
  208. echo the detailed examples given in the on-line guide, accessed by typing D /??
  209. pause
  210. goto templ
  211.  
  212. :stats
  213. cls
  214. echo PocketD can provide additional information about files and present file
  215. echo data in a number of ways. The following gives a few examples of this.
  216. d    /Y123// /'//@tChoose://@t1. Barchart display/@t2. Execution size and Compression/@t3. Extension summary//@tESC cancel//@t?'
  217. cls
  218. if errorlevel 3 goto exten
  219. if errorlevel 2 goto exec
  220. if errorlevel 1 goto bar
  221. goto main
  222.  
  223. :bar
  224. echo The following chart show the relative size of all files represented as a
  225. echo bar chart. (only 1st 14 files shown).                            
  226. echo     D /g                                        
  227. d    /gK.14
  228. echo.
  229. pause
  230. cls
  231. echo The chart is improved by sorting the files by size (ss) & showing the relative
  232. echo percentage usage of each (%%). It also shows the size in terms of space used
  233. echo rather than actual size (U).                            
  234. echo     D /ss /%%U /g       (or D /ss/%Ug- *.BAT etc..)                        
  235. d    /ss/%%UgK.14
  236. echo.
  237. pause
  238. goto stats
  239.  
  240. :exec
  241. echo PocketD can show the minimum run size of an EXE program in KBytes using /M.
  242. echo Executable files can be compressed by PKLITE, DIET, COMPACK and LZEXE. The
  243. echo /C option shows which files are compressed by flagging as p,d,c or l        
  244. echo     D /EMC            ( E=executable  M=exec size  C=Compress check )            
  245. d    /EMC
  246. echo.
  247. pause
  248. goto stats
  249.  
  250. :exten
  251. echo PocketD can summarise files and subdirs by EXTENSION, allowing the user
  252. echo to assess the space used by each extension present.                
  253. echo    D /e                                        
  254. d    /eh.2
  255. echo.                                            
  256. echo This could be used with other options to provide further information. e.g.
  257. echo Showing only the top 4 extensions (in terms of size) and plotting a barchart.    
  258. echo    D /eK.4g%%/ss        (K.4 = 1st 4, /ss = sort by size, g = barchart)        
  259. d    /eK.4g%%/ss/h.2
  260. echo.
  261. pause
  262. goto stats
  263.  
  264. :select
  265. cls
  266. echo PocketD can apply many criteria for selecting files and subdirectories.                
  267. d    /Y123 /'/@tChoose://@t1. Filespecs/@t2. Size/@t3. String searching//@tESC cancel//@t?'
  268. cls
  269. if errorlevel 3 goto string
  270. if errorlevel 2 goto size
  271. if errorlevel 1 goto filesp
  272. goto main
  273.  
  274. :filesp
  275. echo PocketD uses a generalised filespec system that can include and exclude names.
  276. echo The following shows all executable files in the current directory:            
  277. echo  D /mhE/.u       ( m=minimum  h=no header  E=executable  /.u=unbroken names )            
  278. d    /mhE/.u
  279. echo.
  280. echo The group of files selected can be reduced using filespecs:
  281. echo  D /mhE/.u *L*A* G*        ( Only names with an L followed later by A
  282. echo                      or starting with the letter G )            
  283. d    /mhE/.u *L*A* G*
  284. echo.
  285. echo The command line can also include "exclusion" filespecs:
  286. echo  D /mhE/.u *L*A* G* /- *O* ??L*        ( also excluding all names containing O
  287. echo                          or the letter L as the 3rd character)
  288. d    /mhE/.u *L*A* G* /- *O* ??L*
  289. echo.
  290. pause
  291. cls
  292. echo PocketD also allows "type" specifications in filenames, for example:        
  293. echo  D *=D* *=n* /hm                                    
  294. d    *=D* *=n* /hm
  295. echo.                                            
  296. echo This uses "=D" to match any name containing a digit, and "=n" to match
  297. echo any name that contains a non-alphanumeric character (uppercase indicates 
  298. echo match, lowercase for non-match). Also supported: =A/=a match alpha/non-alpha.        
  299. pause
  300. goto select
  301.  
  302. :size
  303. echo PocketD can select files by size (and also date, See D /??).
  304. echo The following shows all non-executable files sorted by size:                
  305. echo     D /h!Ess    ( h=no header  !E=NOT executable  ss=sort by size )            
  306. d    /h!Ess/K.14
  307. echo.
  308. echo A size restriction could be added to this:    
  309. echo     D /h!Ess/}20000        ( greater or equal to 20000 )                
  310. D    /h!Ess/}20000
  311. echo.
  312. echo This could be replaced by a range 3k to 4k (k=Kilobytes):
  313. echo     D /h!Ess/}3k{4k                                    
  314. D    /h!Ess/}3k{4k
  315. pause
  316. goto select
  317.  
  318. :string
  319. echo PocketD can select files by the strings they contain (m=minimum  h=no header):            
  320. echo     D *.BAT /mh'not'    ( only *.BAT files containing 'not' )                
  321. d    *.bat /mh'not' 
  322. echo.
  323. echo This can be inverted to only those not containing 'not':
  324. echo     D *.BAT /mh!'not'    ( !'not' = not including 'not' )            
  325. d    *.BAT /mh!'not'
  326. echo.
  327. echo Extra options can be added to show 1st match found, but no dir listing:
  328. echo     D *.BAT /mh'not'Sd    ( S = show strings  d = no directory )            
  329. d    *.BAT /mh'not'Sd
  330. pause
  331. cls
  332. echo The string searching facility can be used to search for types of character,
  333. echo for example: Numeric digit, Alphabetic, Alpha-numeric, space characters etc..    
  334. echo     D *R*.BAT /hm'subdir'Sd    ( files containing the string 'subdir' )        
  335. d    *R*.bat /hm'subdir'Sd/- d*
  336. echo.
  337. echo This could be modified to find files with 'subdir' but not 'subdirectory':        
  338. echo     D *R*.BAT /hm'subdir@a'Sd    ( @a = non-alphabetic character )        
  339. d    *R*.bat /hm'subdir@a'Sd/- d*
  340. echo.
  341. echo Other options include L/l show/don't show line numbers, * show all strings
  342. echo and "" instead of '' for case-insensitive search.
  343. echo.
  344. pause
  345. goto select
  346.  
  347. :help
  348. cls
  349. echo PocketD comes with a number of documentation files.
  350. echo This demo only gives access to the on-line help.                        
  351. if exist *.diz echo (PocketD will prompt the user for a number between 1-4 before allowing access)
  352. echo.
  353. echo 1. The single page help, accessed by D /?                            
  354. pause
  355. d /?
  356. pause>nul
  357. cls
  358. echo 2. The User Guide, assessed by D /??                            
  359. pause
  360. d /??
  361. cls
  362. echo 3. The on-line manual, given for the example D /?c                        
  363. pause
  364. d /?c
  365. goto main
  366.  
  367. :exit
  368. cls
  369. echo DEMO terminated                                    
  370. echo This demonstration has not covered the following major features:            
  371. echo .  The New MENUD.EXE 60-menu front-end to D.EXE. Try it!
  372. echo .  Color configuration, see SETCOL.EXE
  373. echo .  Browsing through subdirectories and archives (see /Q)
  374. echo .  Scrolling display and execution templates (see UNARC.BAT and Q.BAT)
  375. echo .  COPY/MOVE facilities, including copy to multi-disk, conditional copy,
  376. echo    multiple sources, subtree copying and "safe" copy features.
  377. echo .  ARCHIVE viewing and searching in ZIP/ARC/ZOO/LZH/ARJ/PAK archives
  378. echo .  Using PocketD to emulate utilities such as NCD, WHICH and MAKE etc..
  379. echo .  Using the separate display and execution TEMPLATE(s) to create utilities
  380. echo    that can intelligently interact with the user.
  381. echo .  ENVIRONMENT VARIABLE analysis from command line. e.g. D :PATH
  382. echo .  FILE SEARCH across multiple drives/subdirs using multiple criteria
  383. echo .  TOUCH and full ATTRIB modification of files
  384. echo .  ON-LINE FILE VIEWER in HEX or TEXT, providing text searching.
  385. echo .  ON-LINE BROWSING of file lists
  386. echo .  The 37 USER-DEFINED parameter names                            
  387. echo You are referred to the on-line guide accessed by typing D /?? for these.        
  388.  
  389. :fin1
  390. set d_opt2=
  391. set _=
  392. if "%d_col%"=="" goto fin
  393. :fin
  394.